#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "OLED.h"
#include "MyRTC.h"

int main(void)
{
	OLED_Init();
	MyRTC_Init();
	OLED_ShowString(1, 1, "Date:XXXX-XX-XX");
	OLED_ShowString(2, 1, "Time:XX:XX:XX");
	OLED_ShowString(3, 1, "CNT:");

	while (1)
	{
		MyRTC_ReadTime();
		OLED_ShowNum(1, 6, Time.year, 4);
		OLED_ShowNum(1, 11, Time.month, 2);
		OLED_ShowNum(1, 14, Time.day, 2);
		OLED_ShowNum(2, 6, Time.hour, 2);
		OLED_ShowNum(2, 9, Time.minute, 2);
		OLED_ShowNum(2, 12, Time.second, 2);
		OLED_ShowNum(3, 5, RTC_GetCounter(), 10);	

	}
}
